<li id="choice_goods_category" style="display: list-item;">
	<label>商品类别</label>
	<span class="ui-tree-wrap" id="goods_category_wrap" style="width:122px;position: relative;overflow: visible;">
		<input type="text" class="input-txt" style="width:96px" id="choice_goods_category_name" autocomplete="off"
		placeholder="全部" {if condition='isset($info.goods_category_name)'} value="{$info.goods_category_name}" {else/} value="全部" {/if}><span class="trigger" id="trigger_goods_category" onclick="choice_goods_category()"></span>
	</span>
</li>
<input type="hidden" id="goods_category_id" {if condition='isset($info.goods_category_id)'} value="{$info.goods_category_id}" {else/} value="0" {/if} autocomplete="off" readonly="">

<script type="text/javascript">
  	$(document).ready(function () {
	  	$('#goods_category_tt').tree({
			url: 'getGoodCategory.html',
			onClick: function (node) {
				//console.log(node);
				//商品类别
	           $("#goods_category_id").val(node.id);
	           $("#choice_goods_category_name").val(node.name);
	           $("#goods_category_Box").hide();
			}
		});
       
    })
     //选择商品类别-选择框外点击则隐藏
     $(document).mouseup(function (e) {
      if(e.target.id!="trigger_goods_category"){
            var con = $("#goods_category_Box");   // 设置目标区域
            if (!con.is(e.target) && con.has(e.target).length === 0) {
              $("#goods_category_Box").hide();
            }
        } 
    });

    // 顶部搜索下拉选择窗口(商品类别)
	function choice_goods_category() {
		var top = $("#goods_category_wrap").offset().top;
		var left = $("#goods_category_wrap").offset().left;
		var width = $("#goods_category_wrap").width();
		$("#goods_category_Box").toggle();
		$("#goods_category_Box").css({ "top": (top + 30) + "px", "left": (left) + "px", "minWidth": width + "px" });
	}
</script>